package com.youlu.campus.entity.vote;

import com.youlu.campus.base.base.EntityBase;
import lombok.Data;
import lombok.ToString;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * @author : [dengbo]
 * @className : UserVoteInfoEntity
 * @description : []
 * @createTime : [2022/7/5 11:51]
 */
@Data
@Document(collection = "user_vote_point")
@CompoundIndexes({
        @CompoundIndex(name = "idx_aid_uid", def = "{'activityId':-1,'userId':-1}"),
        //@CompoundIndex(name = "idx_aid_vote_num", def = "{'activityId':-1,'totalVoteNum':-1}")
})
@ToString
public class UserVotePointEntity extends EntityBase {
    /**
     * 活动ID
     */
    private String activityId;
    /**
     * appId
     */
    private String appId;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * openID
     */
    private String openId;
    /**
     * unionId
     */
    private String unionId;
    /**
     * 头像
     */
    protected String avatarUrl;
    /**
     * 昵称
     */
    protected String nickName;
    /**
     * 学校Id
     */
    private String universityId;
    /**
     * 学校名称
     */
    private String universityName;
    /**
     * 学校名称
     */
    private String universityCode;
    /**
     * 学校名称
     */
    private String mobile;
    /**
     * 用户名
     */
    private String userName;
    /**
     * 有效时间票数
     */
    private Long expireNum = 0L;
    /**
     * 永久票数
     */
    private Long permanentNum = 0L;
    /**
     * 总的可用票数
     */
    private Long totalNum = 0L;
    /**
     * 用户投票数量
     */
    private Long totalVoteNum = 0L;
    /**
     * 邀请总人数
     */
    private Long inviteNum = 0L;
    /**
     * 最后领取日期
     */
    private LocalDateTime lastDateTime;
    /**
     * 最后领取时间
     */
    private LocalDate lastDate;
    /**
     * 投票证书领取状态
     */
    private Boolean voteCaReceive = Boolean.FALSE;
    /**
     * 投票证书领取时间
     */
    private LocalDateTime voteCaReceiveTime;
    /**
     * 邀请证书领取状态
     */
    private Boolean inViteCaReceive = Boolean.FALSE;
    /**
     * 邀请证书领取时间
     */
    private LocalDateTime inViteCaReceiveTime;
}
